package com.thor.palmmall.rest.order.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.order.AOrderCondition;
import com.thor.palmmall.spi.order.SOrderCondition;

public class SOrderConditionConverter
		implements
			Converter<AOrderCondition, SOrderCondition> {

	public static SOrderConditionConverter getInstance() {
		if (instance == null)
			instance = new SOrderConditionConverter();
		return instance;
	}

	private static SOrderConditionConverter instance;

private SOrderConditionConverter() {
}

	@Override
	public SOrderCondition convert(AOrderCondition source) {
		if (source == null) {
			return null;
		}
		SOrderCondition target = new SOrderCondition();
		target.setPage(source.getPage());
		target.setPageSize(source.getPageSize());
		target.setFilter(SOrderConditionFilterConverter
				.getInstance().convert(source.getFilter()));
		return target;
	}
}
